home *** CD-ROM | disk | FTP | other *** search
- /*
- ** This script was written by me, so I could compile stuff useing vbcc
- ** through GoldEd. I converted this Script from a Script file written to
- ** compile stuff useing gcc through GoldEd. I truly hope the original
- ** author does not mind this. I hope that whoever finds this script
- ** finds it useful in glueing together a truly cool compiler like vbcc and
- ** a killer Editor like GoldEd. If you have any problems running this
- ** script, try messing with it a little, it's pretty strait forward and
- ** can be modified with little effort. I of course take no liability for
- ** anything this script might do to your computer. (Yeah like a rexx
- ** script is gonna do somethin catostrauphic). I thought that I'de
- ** mention it so I don't get blamed for the end of the world when the
- ** highly improbable does happen. My thanks to Volker Barthelmann for
- ** writeing vbcc. Hope you enjoy useing Golded with vbcc
- **
- ** Sincerely,
- ** Harlock
- **
- */
-
-
-
- OPTIONS RESULTS /* enable return codes */
-
- if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
- address 'GOLDED.1'
-
- 'LOCK CURRENT' /* lock GUI, gain access */
- OPTIONS FAILAT 6 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
-
- host = ADDRESS() /* get GED's port */
-
- /* ------------------------- INSERT YOUR CODE HERE: ------------------ */
-
- options results
- parse arg COM
-
- COM = "vc"
-
- 'QUERY CAT'
-
- 'QUERY ANYTEXT'
-
- if (result = 'TRUE') then
-
- do
- 'QUERY DOC VAR OLDNAME' /* remember current file name */
-
- 'QUERY PATH Var PFAD'
- 'QUERY FILE VAR FNAME'
-
- Name = left(FNAME, Pos('.', FNAME) - 1)
-
- if right(PFAD,1) = ":" then NameB = PFAD || Name
- else NameB = PFAD || '/' || Name
-
- Code = EXISTS(Code)
-
- 'SAVE ALL'
-
- say
- say COM '-+' OLDNAME '-o' NameB
- say
-
- shell
- call pragma 'Stack', 250000
- COM '-+' OLDNAME '-o' NameB
-
- ok = (RC = 0)
-
- shell /* address host (GoldED) */
-
- 'REQUEST BODY="Compilation Complete. Run program ?" BUTTON="_run|_cancel"'
-
- if (result = 1) then do
-
- 'QUERY CON VAR CON'
-
- shell
- run NameB || ' > ' || CON
- shell
-
- end
-
- 'NAME NEW ' || oldname /* restore old file name */
- end
-
- else do
-
- 'REQUEST BODY="Text buffer is empty ?!"'
- end
-
- 'UNLOCK' /* VERY important: unlock GUI */
- Exit
-
- GetFile:PROCEDURE
-
- ARG envv
-
- filename= envv
- IF OPEN(fhandle,filename,"READ") THEN DO
- readed=READLN(fhandle);
- CALL CLOSE(fhandle);
- END;
- ELSE readed = "unset"
-
- RETURN readed
-
-